package com.sc.controller.rui;

import com.sc.result.Result;
import com.sc.service.UtilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @Description:
 * @Author: Rui
 * @Date: 2024/11/25 9:46
 */
@RestController
@RequestMapping("util")
@CrossOrigin
public class UtilController {
    @Autowired
    private UtilService utilService;
    @GetMapping("getFloorVo")
    public Result getFloorVo(){
        return Result.success(utilService.getFloorVo());
    }
    @GetMapping("getHouseTree")
    public Result getHouseTree(){

        return Result.success(utilService.getHouseTree());
    }
    @PostMapping("uploadPic")
    public Result uploadPic(MultipartFile file) throws IOException {
        return Result.success(utilService.uploadPic (file));
    }
}
